package com.yaodian100.ec.payment.service;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import com.yaodian100.core.common.dao.impl.CommonCriteria;
import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.ec.order.entity.Orders;
import com.yaodian100.ec.payment.entity.ApplyCashOut;
import com.yaodian100.ec.payment.entity.ApplyClaim;
import com.yaodian100.ec.payment.entity.BankTransfer;
import com.yaodian100.ec.payment.entity.BonusTransfer;
import com.yaodian100.ec.payment.entity.ThirdPartyTransfer;

public interface TransferService extends DomainService<ThirdPartyTransfer> {

	public boolean bathChargeByBankTransfer() throws CoreException;

	public boolean chargeByBankTransfer(String orderId, String bankTransferId) throws CoreException;

	public boolean chargeByBonusTransfer(Orders order) throws Exception;

	public boolean chargeByThirdPartyTransfer(String thirdPartyId, String tid, String result) throws CoreException;

	/*
	 * 购物金-單日同一會員不可超過1000元
	 */
	public String checkOverOneThousandBonus(String memberId) throws Exception;

	/**
	 * 依id取得提现资料
	 * 
	 * @param id
	 * @return
	 * @throws CoreException
	 */
	public ApplyCashOut getApplyCashOut(String id) throws CoreException;

	/**
	 * 依条件查询提现资料
	 * 
	 * @param firstResult
	 * @param maxResults
	 * @param criteria
	 * @param sortOrder
	 * @return
	 * @throws CoreException
	 */
	public List<ApplyCashOut> getApplyCashOutList(int firstResult, int maxResults, CommonCriteria criteria,
			String[] sortOrder) throws CoreException;

	public Number getApplyCashOutListSize(CommonCriteria criteria) throws CoreException;

	/**
	 * 依id查询招领单资料
	 * 
	 * @param id
	 * @return
	 * @throws CoreException
	 */
	public ApplyClaim getApplyClaim(Serializable id) throws CoreException;

	/**
	 * 依条件查询招领单资料
	 * 
	 * @param firstResult
	 * @param maxResults
	 * @param criteria
	 * @param sortOrder
	 * @return
	 * @throws CoreException
	 */
	public List<ApplyClaim> getApplyClaimList(int firstResult, int maxResults, CommonCriteria criteria, String[] sortOrder)
			throws CoreException;

	/**
	 * 依条件查询招领单笔数
	 * 
	 * @param criteria
	 * @return
	 * @throws CoreException
	 */
	public Number getApplyClaimListSize(CommonCriteria criteria) throws CoreException;

	public BankTransfer getBankTransfer(String oid) throws CoreException;

	public List<BankTransfer> getBankTransferList(int firstResult, int maxResults, CommonCriteria criteria,
			String[] sortOrder) throws CoreException;

	public Number getBankTransferListSize(CommonCriteria criteria) throws CoreException;

	public BonusTransfer getBonusTransfer(String oid) throws CoreException;

	public List<BonusTransfer> getBonusTransferList(int firstResult, int maxResults, CommonCriteria criteria,
			String[] sortOrder) throws CoreException;

	public Number getBonusTransferListSize(CommonCriteria criteria) throws CoreException;

	public boolean refoundBonusTransfer(String orderId, BigDecimal refoundBonus) throws Exception;

	/**
	 * 新增提现资料
	 * 
	 * @param applyCashOut
	 * @return
	 * @throws CoreException
	 */
	public ApplyCashOut saveApplyCashOut(ApplyCashOut applyCashOut) throws CoreException;

	/**
	 * 新增招领单资料
	 * 
	 * @param applyClaim
	 * @return
	 * @throws CoreException
	 */
	public ApplyClaim saveApplyClaim(ApplyClaim applyClaim, byte[] fileBody) throws CoreException;

	public void saveBankTransfer(BankTransfer bankTransfer) throws CoreException;

	public void saveBonusTransfer(BonusTransfer bonusTransfer) throws CoreException;

	/**
	 * 修改提现资料
	 * 
	 * @param applyCashOut
	 * @return
	 * @throws CoreException
	 */
	public ApplyCashOut updateApplyCashOut(ApplyCashOut applyCashOut) throws CoreException;

	/**
	 * 修改招领单资料
	 * 
	 * @param applyClaim
	 * @return
	 * @throws CoreException
	 */
	public ApplyClaim updateApplyClaim(ApplyClaim applyClaim) throws CoreException;

	/**
	 * 修改招领单资料收款状态
	 * 
	 * @param applyClaim
	 * @return
	 * @throws CoreException
	 */
	public String updateApplyClaimStatus(ApplyClaim applyClaim) throws CoreException;

	public String updateBankTransferList(String[] bankIdList, String status) throws CoreException;

	public void updateBankTransfer(BankTransfer bankTransfer) throws CoreException;

	public void updateBonusTransfer(BonusTransfer bonusTransfer) throws CoreException;

}
